package mode.decorator.extend;

/**
 * 装饰器模式-继承方式测试
 *
 * @author xjx
 * @date 2023/7/21 16:05
 */
public class MainTest {
    public static void main(String[] args) {
        FriedRice friedRice = new FriedRice();
        // 炒饭5元
        System.out.println(friedRice.getDesc() + friedRice.getPrice() + "元");
        FriedRice friedRiceAddEgg = new FriedRiceAddEgg();
        // 炒饭+鸡蛋7元
        System.out.println(friedRiceAddEgg.getDesc() + friedRiceAddEgg.getPrice() + "元");
        FriedRice friedRiceAddEggAndHam = new FriedRiceAddEggAndHam();
        // 炒饭+鸡蛋+火腿10元
        System.out.println(friedRiceAddEggAndHam.getDesc() + friedRiceAddEggAndHam.getPrice() + "元");
    }
}
